package com.caisejingyu.whales.home.api

import com.caisejingyu.whales.common.api.BaseResponse
import com.caisejingyu.whales.home.data.*
import io.reactivex.Flowable
import io.reactivex.Observable
import retrofit2.Call
import retrofit2.http.GET
import retrofit2.http.Query

interface WhalesApi {

    /**
     * 获取轮播图
     */
    @GET("api/v1/banner")
    fun banner(): Call<BaseResponse<List<BannerRespons>>>

    /**
     * 获取二维码
     */
    @GET("mock/19/api/v1/banner")
    fun wxQrcode(): Call<BaseResponse<List<BannerRespons>>>


    /**
     * 打印队列轮训
     */
    @GET("api/v1/printer/queue")
    fun pollingPrint(
    ): Flowable<BaseResponse<List<PollingPrintResponse>>>

    /**
     * 命令队列轮训
     */
    @GET("api/v1/cmd/get")
    fun pollingCmd(
    ): Call<BaseResponse<List<CmdRespons>>>


    /**
     * 机器初始化
     */
    @GET("api/v1/machine/init")
    fun machineInit(
            @Query("aid") param: String
    ): Observable<BaseResponse<InitResponst>>


    /**
     * 相框
     */
    @GET("api/v1/rahmen/list")
    fun rahmenInit(): Observable<BaseResponse<List<RahmenResponst>>>


    /**
     * 7牛上传 token
     */
    @GET("api/v1/qiniu/token")
    fun qiniuToken(): Call<BaseResponse<QiniuRespons>>


    /**
     * 获取现场二维码
     */
    @GET("api/v1/qrcode/now")
    fun qrcodeNow(@Query("image") image: String,@Query("localImage") localImage: String): Call<BaseResponse<QrcodeRespons>>


    /**
     * 机器命令上报
     */
    @GET("api/v1/cmd/status")
    fun cmdStatus(@Query("id") id: String, @Query("status") status: Int, @Query("reason") reason: String): Call<BaseResponse<QrcodeRespons>>


    /**
     * 打印状态上报
     */
    @GET("api/v1/printer/status")
    fun printStatusReport(
            @Query("id") id: String,
            @Query("status") status: String
    ): Call<BaseResponse<Any>>


}